#include "StdFile.h"
#include<stdio.h>
#include<stdlib.h>
char *LoadFromFile(const char *filepath)
{
    FILE *file=fopen(filepath,"r");
    if(file==NULL)
    {
        printf("open file error! path:%s \n",filepath);
        return 0;
    }

    fseek(file,0,SEEK_END);
    long size=ftell(file);

    fseek(file,0,SEEK_SET);
    char *content=(char *)malloc(size);
    if(content==NULL)
    {
        printf("LodeFromFile malloc error!\n");
        fclose(file);
        return NULL;
    }
    fread(content,size,1,file);
    fclose(file);
    return content;
}


